﻿#--------------------------------------------
# Declare Global Variables and Functions here
#--------------------------------------------


function Get-ScriptFullPath
{
	$script:MyInvocation.MyCommand.Path
}

#Sample function that provides the location of the script
function Get-ScriptDirectory
{ 
	if($hostinvocation -ne $null)
	{
		Split-Path $hostinvocation.MyCommand.path
	}
	else
	{
		Split-Path $script:MyInvocation.MyCommand.Path
	}
}

function IsAdministrator
{
    $Identity = [System.Security.Principal.WindowsIdentity]::GetCurrent()
    $Principal = New-Object System.Security.Principal.WindowsPrincipal($Identity)
    $Principal.IsInRole([System.Security.Principal.WindowsBuiltInRole]::Administrator)
}

#Sample variable that provides the location of the script
[string]$ScriptDirectory = Get-ScriptDirectory
[string]$FullScriptPath = Get-ScriptFullPath